	
*============================================ PRELIMINARIES =================================================================*



	* Directories 
	//Main globals for replication package 
	global root "/nfs/pool001/psastry/Floods/RFSReplicationPackage"
	global repfinaldata "$root/datasets"
	global repoutput "$root/output"
	global mergediagnostics  "$root/RFSReplicationPackage/datasets_mergediagnostics"
	
	*packages required 
	ssc install binscatter 
	ssc install reghdfe 
	ssc install spmap 
	ssc install maptile 
	ssc install texsave 
	ssc install estout 
	ssc install outreg 
	ssc install outreg2 
	ssc install coefplot 
	ssc install distinct 
	ssc install parmest 


	* Key Globals Lists of Variables 
	global mort_controls log_OriginalPropertyValue OriginalTerm ///
		OriginalCreditScore_reg DTI_reg  ///
		I_mi_DTI I_mi_Credit log_hmda_income
	global mort_type FirstMort SecondHome LowGrade FHA_VA FullDocument JumboAtOriginationFlag AdjustableRate
	global controls_ltv $mort_controls $mort_type OtherLTV_reg I_mi_CLTV nfip_takeup
	global restricted log_OriginalPropertyValue OriginalTerm  DTI_reg I_mi_DTI $mort_type OtherLTV_reg I_mi_CLTV nfip_takeup
	global controls_dte I_mi_CreditScore I_mi_r2 
	global controls_pooled log_r2 OriginalCreditScore_reg I_mi_Cr  DTI_reg I_mi_D
	*Summ Stats Globals (Table 1, Appendix Table A.2)
	global loan_descript OriginalCreditScore hmda_app_income OriginalPropertyValue OriginalLTV OriginalInterestRate I_del OriginalTerm DTIH CLTV
	global loan_long OriginalLoanAmount DTIH SecondHome LowGrade FHA_VA FullDocument JumboAtOriginationFlag r2 rs_BuildingAreaSqFt I_r2
	*Balance Table Globals (Table 4)
	global eventstudyvars_bt OriginalLTV OriginalInterestRate ///
		OriginalLoanAmount OriginalPropertyValue OriginalTerm OriginalCreditScore ///
		hmda_app_income  CLTV ///
		r2 rs_BuildingAreaSqFt ///
		JumboAtOriginationFlag 
	global floodinsurance_bt takeup_SHFA takeup_noSHFA C_claim_mean
	global zipcode_bt acs_num_hunits acs_pop_growth HMDA_denialrate 
	global balancevars $eventstudyvars_bt $floodinsurance_bt $zipcode_bt 

	* Tablenotes
	global se_note = "Standard errors in parentheses, clustered at the county level."
	global star_note = "* p $<$ 0.10, ** p $<$ 0.05, *** p $<$ 0.01"

	* graph formats 
	
	** ado paths and colors
	adopath ++ "/nfs/pool001/psastry/Floods/RFSReplicationPackage/code/ados"
	set scheme PS_Custom
	global pgp_red "213 94 0"
	global pgp_blue "0 114 178"	
	global pgp_yellow "240 228 66"	
	global pgp_green "0 158 115"	
abc

*============================================ RUN MAIN PAPER TABLES/FIGURES FILES =================================================================*
	run 2_MainTables_final.do // Creates Tables 1-7 of the paper 
	run 3_MainFigures_final.do // Creates Figures 1-4 of the paper 

*============================================ RUN APPENDIX TABLES/FIGURES FILES =================================================================*
	
	run 4_AppendixTables_final.do 
	run 5_AppendixFigures_final.do 
	
